<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Module mb</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module mb</h1>
<ul class="index"><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>


<h2><a name="types">Data Types</a></h2>

<h3 class="typedecl"><a name="type-mbString">mbString()</a></h3>
<p><tt>mbString() = {Encoding::atom(), String::binary()}</tt></p>


<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#bocu-1">bocu/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#charToInt-1">charToInt/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#convertEncoding-2">convertEncoding/2</a></td><td>converts an mb string from Encoding to NewEncoding.</td></tr>
<tr><td valign="top"><a href="#format-1">format/1</a></td><td>formats the mbstring for output.</td></tr>
<tr><td valign="top"><a href="#fwrite-2">fwrite/2</a></td><td>outputs an mbstring to a file.</td></tr>
<tr><td valign="top"><a href="#getNextCharAsInt-1">getNextCharAsInt/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#hasProcess-1">hasProcess/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#hasTable-1">hasTable/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#hexString_to_List-1">hexString_to_List/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#init-0">init/0</a></td><td>reads the unicode- and encodings-related tables and builds them if absent.</td></tr>
<tr><td valign="top"><a href="#isASCII-1">isASCII/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#len-1">len/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#lenB-1">lenB/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#new-0">new/0</a></td><td>creates a new empty mb string, a tuple {encoding_atom, &lt;&lt;""&gt;&gt;}.</td></tr>
<tr><td valign="top"><a href="#new-1">new/1</a></td><td>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}.</td></tr>
<tr><td valign="top"><a href="#new-2">new/2</a></td><td>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}.</td></tr>
<tr><td valign="top"><a href="#new-3">new/3</a></td><td>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}.</td></tr>
<tr><td valign="top"><a href="#print-1">print/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#print-2">print/2</a></td><td>formats an mbstring and outputs it.</td></tr>
<tr><td valign="top"><a href="#reset-0">reset/0</a></td><td>rebuilds the unicode- and encodings-related tables.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="bocu-1">bocu/1</a></h3>
<div class="spec">
<p><tt>bocu(X1) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="charToInt-1">charToInt/1</a></h3>
<div class="spec">
<p><tt>charToInt(Char) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="convertEncoding-2">convertEncoding/2</a></h3>
<div class="spec">
<p><tt>convertEncoding(OriginalString::<a href="#type-mbString">mbString()</a>, NewEncoding::atom()) -&gt; <a href="#type-mbString">mbString()</a></tt><br></p>
</div><p><p>converts an mb string from Encoding to NewEncoding.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HONG2=mb:convertEncoding({utf8, "\345\274\230"}, utf16).
  {utf16,&lt;&lt;95,24&gt;&gt;}
  </pre></p>

<h3 class="function"><a name="format-1">format/1</a></h3>
<div class="spec">
<p><tt>format(MBString::<a href="#type-mbString">mbString()</a>) -&gt; list()</tt><br></p>
</div><p><p>formats the mbstring for output.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HAN=mb:new("\345\257\222"). ==&gt; That's [U+5BD2]/Cold.
  {utf8,&lt;&lt;229,175,146&gt;&gt;}
  2&gt; io:format("~s~n",[mb:format(HAN)]).
  \345\257\222
  </pre> Just a hack really.</p>
<p><b>See also:</b> <a href="#fwrite-2">fwrite/2</a>, <a href="#print-1">print/1</a>, <a href="#print-2">print/2</a>.</p>

<h3 class="function"><a name="fwrite-2">fwrite/2</a></h3>
<div class="spec">
<p><tt>fwrite(MBString::<a href="#type-mbString">mbString()</a>, FileName::list()) -&gt; atom()</tt><br></p>
</div><p><p>outputs an mbstring to a file.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HAN=mb:new("\345\257\222"). ==&gt; That's [U+5BD2]/Cold.
  {utf8,&lt;&lt;229,175,146&gt;&gt;}
  2&gt; mb:fwrite(HAN, MyFile).
  ok
  </pre></p>
<p><b>See also:</b> <a href="#format-1">format/1</a>, <a href="#print-1">print/1</a>, <a href="#print-2">print/2</a>.</p>

<h3 class="function"><a name="getNextCharAsInt-1">getNextCharAsInt/1</a></h3>
<div class="spec">
<p><tt>getNextCharAsInt(X1) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="hasProcess-1">hasProcess/1</a></h3>
<div class="spec">
<p><tt>hasProcess(X) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="hasTable-1">hasTable/1</a></h3>
<div class="spec">
<p><tt>hasTable(X) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="hexString_to_List-1">hexString_to_List/1</a></h3>
<div class="spec">
<p><tt>hexString_to_List(Code) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="init-0">init/0</a></h3>
<div class="spec">
<p><tt>init() -&gt; atom()</tt><br></p>
</div><p>reads the unicode- and encodings-related tables and builds them if absent
 </p>
<p><b>See also:</b> <a href="#reset-0">reset/0</a>.</p>

<h3 class="function"><a name="isASCII-1">isASCII/1</a></h3>
<div class="spec">
<p><tt>isASCII(Tring) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="len-1">len/1</a></h3>
<div class="spec">
<p><tt>len(MyString) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="lenB-1">lenB/1</a></h3>
<div class="spec">
<p><tt>lenB(X1) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="new-0">new/0</a></h3>
<div class="spec">
<p><tt>new() -&gt; <a href="#type-mbString">mbString()</a></tt><br></p>
</div><p><p>creates a new empty mb string, a tuple {encoding_atom, &lt;&lt;""&gt;&gt;}.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HAN=mb:new("").
  {utf8,&lt;&lt;&gt;&gt;}
  </pre></p>
<p><b>See also:</b> <a href="#new-1">new/1</a>, <a href="#new-2">new/2</a>, <a href="#new-3">new/3</a>.</p>

<h3 class="function"><a name="new-1">new/1</a></h3>
<div class="spec">
<p><tt>new(String::list()) -&gt; <a href="#type-mbString">mbString()</a></tt><br></p>
</div><p><p>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}. You can specify the encoding, and even request an on-the-fly conversion.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HAN=mb:new("\345\257\222"). ==&gt; That's [U+5BD2]/Cold.
  {utf8,&lt;&lt;229,175,146&gt;&gt;}
  </pre></p>
<p><b>See also:</b> <a href="#new-0">new/0</a>, <a href="#new-2">new/2</a>, <a href="#new-3">new/3</a>.</p>

<h3 class="function"><a name="new-2">new/2</a></h3>
<div class="spec">
<p><tt>new(String::list(), OriginalEncoding::atom()) -&gt; <a href="#type-mbString">mbString()</a></tt><br></p>
</div><p><p>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}. You can specify the encoding, and even request an on-the-fly conversion.</p>
 
  <p>Example</p>
  <pre>
  2&gt; HONG=mb:new(&lt;&lt;"\345\274\230"&gt;&gt;). ==&gt; That's [U+5F18]/Strong
  {utf8,&lt;&lt;229,188,152&gt;&gt;}
  </pre></p>
<p><b>See also:</b> <a href="#new-0">new/0</a>, <a href="#new-1">new/1</a>, <a href="#new-3">new/3</a>.</p>

<h3 class="function"><a name="new-3">new/3</a></h3>
<div class="spec">
<p><tt>new(String::list(), OriginalEncoding::atom(), RequestedEncoding::atom()) -&gt; <a href="#type-mbString">mbString()</a></tt><br></p>
</div><p><p>creates a new mb string, a tuple {encoding_atom, &lt;&lt;Binary_String&gt;&gt;}. You can specify the encoding, and even request an on-the-fly conversion.</p>
 
  <p>Example</p>
  <pre>
  3&gt; HONG2=mb:new("\345\274\230", utf8, utf16).
  {utf16,&lt;&lt;95,24&gt;&gt;}
  </pre></p>
<p><b>See also:</b> <a href="#new-0">new/0</a>, <a href="#new-1">new/1</a>, <a href="#new-2">new/2</a>.</p>

<h3 class="function"><a name="print-1">print/1</a></h3>
<div class="spec">
<p><tt>print(MBString::<a href="#type-mbString">mbString()</a>) -&gt; atom()</tt><br></p>
</div>
<p><b>See also:</b> <a href="#format-1">format/1</a>, <a href="#fwrite-2">fwrite/2</a>, <a href="#print-2">print/2</a>.</p>

<h3 class="function"><a name="print-2">print/2</a></h3>
<div class="spec">
<p><tt>print(MBString::<a href="#type-mbString">mbString()</a>, Params::list()) -&gt; atom()</tt><br></p>
</div><p><p>formats an mbstring and outputs it.</p>
 
  <p>Example</p>
  <pre>
  1&gt; HAN=mb:new("\345\257\222"). ==&gt; That's [U+5BD2]/Cold.
  {utf8,&lt;&lt;229,175,146&gt;&gt;}
  2&gt; mb:print(HAN, ["\n"]).
  \345\257\222
  ok
  </pre></p>
<p><b>See also:</b> <a href="#format-1">format/1</a>, <a href="#fwrite-2">fwrite/2</a>, <a href="#print-1">print/1</a>.</p>

<h3 class="function"><a name="reset-0">reset/0</a></h3>
<div class="spec">
<p><tt>reset() -&gt; atom()</tt><br></p>
</div><p>rebuilds the unicode- and encodings-related tables. What it <b>really</b> does is delete the dets tables.
 </p>
<p><b>See also:</b> <a href="#init-0">init/0</a>.</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Jul 30 2011, 15:55:10.</i></p>
</body>
</html>
